home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 9
/
Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO
/
015a
/
ben311.zip
/
!BENDEMO.EXE
/
BENDEMO.BAT
next >
Wrap
DOS Batch File
|
1993-05-15
|
11KB
|
214 lines
@Echo Off
:BENDEMO.BAT - A Demo Batch File That Demonstrates BEN
:(C) 1993 by Simvis Soft
:All Rights Reserved
:This batch file requires BENDEMO.DA1 through BENDEMO.DA5
:to function properly. Also, ANSI.SYS should by installed.
:Otherwise, some minor color errors will occur.
BEN Savepath
BEN T BENDEMO.DA1
If Errorlevel 2 Goto CloseDown
If "%BEN%"=="" Set BEN=Nameless
Set NAME=%BEN%
:MainMenu
BEN Flush / MenuF BENDEMO.MNU
If Errorlevel 8 Goto CloseDown
If Errorlevel 7 Goto VideoMode
If Errorlevel 6 Goto ScrollingAround
If Errorlevel 5 Goto SoundAndMusic
If Errorlevel 4 Goto UserInput
If Errorlevel 3 Goto EnhancedEcho
If Errorlevel 2 Goto BoxesEveryWhere
If Errorlevel 1 Goto DirectoryAndFiles
Goto CloseDown
:----------------------------------------------------------------------------
:DirectoryAndFiles
BEN Cls LightGray / ShadFilledBox 6 3 75 23 Brown Green 2
BEN Locate 1 9 / WriteC White Green %NAME%,~you~can~now~produce~batch~files
BEN WriteC White Green with~high~degree~of~control~over~directories~and~files!
BEN Locate 1 12 / WriteC LightCyan Green Just~try~our~directory~dialog~box~first!
BEN Locate 1 14 / WriteC Blue Green Please~enter~a~pathname~(Eg.~C:\TELECOM\MODEM):
BEN Box 19 16 58 16 Black LightGray 0 / Color Black LightGray
BEN Locate 20 16 / Cursor Full / Flush / GetLine / Cursor Off
If "%BEN%"=="" Set BEN=.
BEN DirDisp %BEN%
If "%BEN%"=="" Goto SelectFileNot
:ReturnFromSelectFileNot
Set SELECT=%BEN%
BEN Cls LightGray / TitledBox 6 3 75 23 White Blue 1 With~BEN,~it's~easy~to~break~a~full~filename~into~its~components:
BEN Locate 25 10 / Write LightGray Blue Full~Filename:~; Write White Blue %SELECT%
BEN Extract %SELECT% D
BEN Locate 25 11 / Write LightGray Blue Drive:~~~~~~~~~; / Write White Blue %BEN%
BEN Extract %SELECT% P\
BEN Locate 25 12 / Write LightGray Blue Path:~~~~~~~~~~; / Write White Blue %BEN%
BEN Extract %SELECT% N
BEN Locate 25 13 / Write LightGray Blue Name:~~~~~~~~~~; / Write White Blue %BEN%
BEN Extract %SELECT% E
If "%BEN%"=="" Set BEN=
BEN Locate 25 14 / Write LightGray Blue Extension:~~~~~; / Write White Blue %BEN%
BEN Extract %SELECT% N.E
BEN Locate 25 15 / Write LightGray Blue Filename:~~~~~~; / Write White Blue %BEN%
BEN GetCD
BEN Locate 1 21 / WriteC Yellow Blue By~the~way,~you~are~currently~in~%BEN%!
BEN Locate 1 22 / WriteC Cyan LightBlue Please~press~any~key~to~continue~.~.~. / Flush / PAUSE
BEN Message Now~you~are~going~to~examine~our~file browsing~capability.~Press~ENTER and~you~will~see~BENDEMO.BAT.
BEN List BENDEMO.BAT BENDEMO.BAT,~the~batch~file~you~are~running:
BEN Message Isn't~that~great?~Now~try~to~zoom, move~and~size~the~browsing~window!
BEN List BENDEMO.DA1 Try~to~zoom,~move~and~size~the~window~with~F5,~CTRL-F5~and~ALT-F5!
BEN Message What~you~have~seen~was~just~a~small part~of~BEN.~Go~ahead~and~select other~parts~of~the~demo!
Goto MainMenu
:SelectFileNot
BEN Message You~left~without~selecting~any~file. Let's~assume~that~you~have~selected ~~~~~~~"C:\DOS\DISKCOPY.COM"
Set BEN=C:\DOS\DISKCOPY.COM
Goto ReturnFromSelectFileNot
:----------------------------------------------------------------------------
:BoxesEveryWhere
BEN GrowFilledBox 1 1 80 25 LightGray Blue 0 / Locate 1 12
BEN WriteC White Blue With~BEN,~you~can~produce~many~kinds~of~neat~boxes~in~batch~files. / Locate 1 14
BEN WriteC Yellow Blue Just~sit~back~and~enjoy~the~boxing~show. / Delay 5000 / Cls LightGray
BEN GrowFilledBox 1 25 80 25 Blue Blue 0 / Box 5 5 50 23 Green Blue 1 / Locate 1 25 / WriteC Yellow Blue Normal~Box;
BEN Delay 3000 / FilledBox 7 7 60 20 LightGray Brown 2 / Locate 1 25 / WriteC Yellow Blue Filled~Box;
BEN Delay 3000 / Box 3 3 79 10 Black Green 251 / Locate 1 25 / WriteC Yellow Blue ASCII~Bordered~Box;
BEN Delay 3000 / TransparentBox 10 3 40 15 Cyan Magenta / Locate 1 25 / WriteC Yellow Blue ~~Transparent~Box~~;
BEN Delay 3000 / ShadFilledBox 15 5 75 21 LightGray Red 5 / Locate 1 25 / WriteC Yellow Blue ~~Shadowed~Box~~;
BEN Delay 3000 / GrowFilledBox 32 2 60 17 Blue Cyan 0 / Locate 1 25 / WriteC Yellow Blue ~Growing~Box~;
BEN Delay 3000 / TitledBox 3 3 78 22 Yellow Red 1 Welcome~to~BENDEMO,~%NAME%!
BEN Locate 1 25 / WriteC Yellow Blue ~Titled~Box~;
BEN Delay 3000 / Message ~~~~And~Message~Box,~of~course! Press~ENTER~to~return~to~Main~Menu!
Goto MainMenu
:----------------------------------------------------------------------------
:EnhancedEcho
BEN Cls Black / Locate 1 13 / WriteC LightGray Black Why~settle~for~the~plain~gray~on~black~Echo~command?;
BEN Cursor On / Delay 3000 / Cursor Off / Cls Cyan / GrowFilledBox 5 3 76 23 Blue Blue 0
BEN WriteV 77 5 DARKGray Black B~E~N~~~B~E~N~~~B~E
BEN Locate 28 4 / Write White Blue When~you~can~have~this:
BEN Locate 25 6 / Write LightMagenta Blue Hello / Sound 50 50
BEN Locate 28 8 / Write Green Blue user! / Sound 100 100
BEN Locate 31 10 / Write Red Blue Welcome / Sound 75 100
BEN Locate 34 12 / Write LightGreen Blue to / Sound 50 100
BEN Locate 37 14 / Write Yellow Blue BEN, / Sound 80 100
BEN Locate 40 16 / Write LightCyan Blue the / Sound 60 100
BEN Locate 43 18 / Write LightMagenta Blue Batch / Sound 100 100
BEN Locate 45 20 / Write LightGreen Blue ENhancer! / Sound 75 100
BEN Locate 1 22 / WriteC White LightBlue Press~Any~Key~to~Continue~.~.~. / Flush / PAUSE
Goto MainMenu
:----------------------------------------------------------------------------
:UserInput
BEN Cls Red GrowFilledBox 5 3 76 23 White Magenta 1
BEN Locate 1 10 / WriteC White Magenta BEN~is~very~good~with~dealing~with~user~input.
BEN Locate 1 12 / WriteC Yellow Magenta The~menu~that~brought~you~here~is~itself~a~fine~example.
BEN ShadFilledBox 10 15 71 19 Blue Blue 0
BEN Color Black LightGray / Locate 1 16 / WriteC White Blue Please~enter~your~favourite~color,~%NAME%
:GetFColor
BEN Box 30 18 50 18 Black LightGray 0 / Locate 31 18 / Cursor Full / Flush / GetLineL / Cursor Off / Sound 50 50
If "%BEN%"=="" Goto FColorEnteredNot
Set FColor=%BEN%
BEN Color LightGray Black / Locate 1 16 / WriteC Yellow Blue ~Now,~enter~your~favourite~animal,~%NAME%~
:GetFAnimal
BEN Box 30 18 50 18 LightGray Black 0 / Locate 31 18 / Cursor Full / Flush / GetLineL / Cursor Off / Sound 50 50
If "%BEN%"=="" Goto FAnimalEnteredNot
BEN GrowFilledBox 10 5 71 21 Cyan Cyan 0 / Locate 1 7 / WriteC Black Cyan We~have~a~conclusion:
BEN Locate 1 13 / WriteC Red Cyan "%NAME%~loves~to~eat~%FColor%~%BEN%!"
BEN Locate 1 18 / WriteC Blue LightCyan Ha!~Ha!~Ha!
BEN Locate 1 20 / WriteC Magenta Cyan Please~press~any~key~to~go~on~with~our~demo~.~.~. / Flush / PAUSE
Set FColor=
BEN ShadFilledBox 1 1 80 25 LightCyan Red 5 / GrowFilledBox 10 8 70 14 Brown Brown 0
BEN Locate 1 9 / WriteC Yellow Brown Now,~press~any~number~key~to~test~
BEN WriteC Yellow Brown BEN's~key~handling~capability.
BEN WriteC White Brown (Press~'Q'~to~quit)
BEN Locate 1 13 / WriteC LightCyan Brown (BEN~will~reject~all~other~keys)
:AskLoop
BEN ASK 1234567890Q
If Errorlevel 11 Goto MainMenu
If Errorlevel 10 If Not Errorlevel 11 Set BEN=0
If Errorlevel 9 If Not Errorlevel 10 Set BEN=9
If Errorlevel 8 If Not Errorlevel 9 Set BEN=8
If Errorlevel 7 If Not Errorlevel 8 Set BEN=7
If Errorlevel 6 If Not Errorlevel 7 Set BEN=6
If Errorlevel 5 If Not Errorlevel 6 Set BEN=5
If Errorlevel 4 If Not Errorlevel 5 Set BEN=4
If Errorlevel 3 If Not Errorlevel 4 Set BEN=3
If Errorlevel 2 If Not Errorlevel 3 Set BEN=2
If Errorlevel 1 If Not Errorlevel 2 Set BEN=1
BEN Sound 50 50 / Locate 1 18 / WriteC LightMagenta Red You~just~pressed~the~"%BEN%"~key!
Goto AskLoop
:FColorEnteredNot
BEN Message Please~do~enter~something!
Goto GetFColor
:FAnimalEnteredNot
BEN Message Please~do~enter~something!
Goto GetFAnimal
:----------------------------------------------------------------------------
:SoundAndMusic
BEN T BENDEMO.DA2
rem Draws "The Music Work Shop" background by calling BENDEMO.DA2
:MusicAskLoop
BEN ASK EIBQ
If Errorlevel 4 If Not Errorlevel 5 Goto MainMenu
If Errorlevel 3 If Not Errorlevel 4 Goto SelectBeep
If Errorlevel 2 If Not Errorlevel 3 BEN T BENDEMO.DA4
If Errorlevel 1 If Not Errorlevel 2 BEN T BENDEMO.DA3
Goto MusicAskLoop
:SelectBeep
BEN Scroll 54 5 76 17 Right / Scroll 55 5 77 17 Right / TransparentBox 57 18 77 18 Red Red
BEN Beep / Scroll 56 5 78 18 Left / Scroll 55 5 77 18 Left / TransparentBox 57 18 77 18 0 0 / TransparentBox 76 6 77 17 0 0
Goto MusicAskLoop
:----------------------------------------------------------------------------
:ScrollingAround
BEN T BENDEMO.DA5
Goto MainMenu
:----------------------------------------------------------------------------
:VideoMode
BEN GrowFilledBox 5 3 76 23 White Blue 1 / GetVIDEO
BEN Locate 1 10 / WriteC White Blue Let's~see~what~kind~of~video~system~you~have.
BEN Locate 1 13 / WriteC LightCyan Blue Oh!~You've~got~a~%BEN%~video~system!
If "%BEN%"=="EGA" Goto EGAVGA
If "%BEN%"=="VGA" Goto EGAVGA
BEN Locate 1 16 / WriteC Yellow Blue Too~bad~you~don't~have~an~EGA~or~a~VGA~video~system.
BEN Locate 1 17 / WriteC Yellow Blue Otherwise,~we~can~show~you~BEN's~EGAVGA~function.
BEN Locate 1 22 / WriteC LightGray LightBlue Well,~please~press~any~key~to~return~to~the~menu~.~.~. / Flush / PAUSE
Goto MainMenu
:EGAVGA
BEN Beep Locate 1 16 / WriteC Yellow LightBlue Neat!~Press~any~key~to~switch~to~extended~line~mode~.~.~.
BEN Flush / PAUSE / EGAVGA On / Cls Cyan
If "%BEN%"=="EGA" BEN GrowFilledBox 5 3 76 41 White Blue 2
If "%BEN%"=="VGA" BEN GrowFilledBox 5 3 76 48 White Blue 2
BEN Locate 1 20 WriteC Yellow Blue ╒═════╗~╒══════╗~╒══════╗~~~~~╒═╗~╒═╗~~~~╒═╗~╒══════╗~╒══════╗
BEN Locate 1 21 WriteC Yellow Blue │~╓───╜~│~╓────╜~│~╓──┐~║~~~~╒╛╓╜~│~║~~~~│~║~│~╓────╜~│~╓──┐~║
BEN Locate 1 22 WriteC Yellow Blue │~╚═╗~~~│~║~╒══╗~│~╚══╛~║~~~╒╛╓╜~~└┐╚╗~~╒╛╓╜~│~║~╒══╗~│~╚══╛~║
BEN Locate 1 23 WriteC Yellow Blue │~╓─╜~~~│~║~└┐~║~│~╓──┐~║~~╒╛╓╜~~~~└┐╚╗╒╛╓╜~~│~║~└┐~║~│~╓──┐~║
BEN Locate 1 24 WriteC Yellow Blue │~╚═══╗~│~╚══╛~║~│~║~~│~║~╒╛╓╜~~~~~~└┐╚╛╓╜~~~│~╚══╛~║~│~║~~│~║
BEN Locate 1 25 WriteC Yellow Blue └─────╜~└──────╜~└─╜~~└─╜~└─╜~~~~~~~~└──╜~~~~└──────╜~└─╜~~└─╜
BEN Locate 1 35 WriteC White Blue Mode~is~currently~activated,~as~you~might~have~seen!
BEN Locate 1 40 WriteC LightMagenta LightBlue Press~any~key~to~return~to~25~lines~mode.
BEN Flush / PAUSE / EGAVGA Off / Cursor Off / TitledBox 1 1 80 25 White Red 1 BEN~-~the~Batch~ENhancer~(c)~1993
Goto MainMenu
:----------------------------------------------------------------------------
:CloseDown
Set NAME=
BEN CleanUp
Cls
Echo BENDEMO.BAT - A Demo Batch File That Demonstrates BEN
Echo
Echo Thank you for taking your time to evaluate our demo.
Echo We hope that you would take a look at other files that
Echo are included in the BEN package as well (eg. BENEDIT).
Echo
Echo Thanks!
Echo